
////// Replication Files: Burge, Wamble, and Cuomo - "A Certain Type of Descriptive Representative" /// 



////////////  CONSTRUCTING TREATMENT CONDITIONS //////// 
tab gc 

gen tgroup=.
replace tgroup=1 if q238==1 
replace tgroup=2 if q34==1 
replace tgroup=3 if q296==1 
replace tgroup=4 if q89==1
replace tgroup=5 if q90==1 
replace tgroup=6 if q302==1
tab tgroup

lab def tgroup 1"Julie" 2"Light Julie" 3"Dark Julie" 4"James" 5"Light James" 6"Dark James"
lab val tgroup tgroup
tab tgroup

gen tgroup2=. 
replace tgroup2=1 if tgroup==1
replace tgroup2=2 if tgroup==2
replace tgroup2=3 if tgroup==3
replace tgroup2=4 if tgroup==4
replace tgroup2=5 if tgroup==5
replace tgroup2=6 if tgroup==6 
tab tgroup2
lab def tgroup2 1"Julie" 2"Light Julie" 3"Dark Julie" 4"James" 5"Light James" 6"Dark James"
lab val tgroup2 tgroup2
tab tgroup2


// Pooled Experimental Conditions w/ Control // 
gen tonegroup=. 
replace tonegroup=1 if q238==1|q89==1 
replace tonegroup=2 if q34==1|q90==1
replace tonegroup=3 if q296==1|q302==1
tab tonegroup

lab def tonegroup 1"No Image" 2"Light Image" 3"Dark Image"
lab val tonegroup tonegroup
tab tonegroup 


// Pooled Experimental Conditions - Light and Dark Candidates // 
gen pooled=. 
replace pooled=0 if tonegroup==2 //Light conditions
replace pooled=1 if tonegroup==3 // Dark conditions
tab pooled 
tab tonegroup 

gen ldkpool=.
replace ldkpool=1 if tonegroup==2
replace ldkpool=2 if tonegroup==3
tab ldkpool
lab def ldkpool 1"Light Image" 2"Dark Image"
lab val ldkpool ldkpool 
tab ldkpool


// Experimental Conditions by Gender /// 
gen womenconds=. 
replace womenconds=1 if tgroup==1
replace womenconds=2 if tgroup==2
replace womenconds=3 if tgroup==3
tab womenconds 
lab def womenconds 1"No Image" 2"Light Julie" 3"Dark Julie"
lab val womenconds womenconds
tab womenconds

gen menconds=. 
replace menconds=1 if tgroup==4
replace menconds=2 if tgroup==5
replace menconds=3 if tgroup==6
tab menconds
lab def menconds 1"No Image" 2"Light James" 3"Dark James"
lab val menconds menconds
tab menconds

//Experimental Conditions by Gender and Skin Tone // 
** Julie 
gen womenconds2=. 
replace womenconds2=0 if womenconds==2 //Light Julie
replace womenconds2=1 if womenconds==3 //Dark Julie
tab womenconds2
tab womenconds
tab tgroup

lab def womenconds2 0"Light Julie" 1"Dark Julie" 
lab val womenconds2 womenconds2
tab womenconds2

gen toneJulie=. 
replace toneJulie=0 if womenconds==2 // Light Julie 
replace toneJulie=1 if womenconds==3 // Dark Julie 
tab toneJulie

** James 
gen menconds2=.
replace menconds2=0 if menconds==2 //Light James
replace menconds2=1 if menconds==3 //Dark James
tab menconds2
tab menconds
tab tgroup

lab def menconds2 0"Light James" 1"Dark James" 
lab val menconds2 menconds2
tab menconds2

gen toneJames=. 
replace toneJames=0 if menconds==2 //Light James 
replace toneJames=1 if menconds==3 //Dark James 
tab toneJames


** Dark Julie and Dark James 
gen darkcands=. 
replace darkcands=1 if tgroup==3 
replace darkcands=2 if tgroup==6
tab darkcands

lab def darkcands 1"Dark Julie" 2"Dark James"
lab val darkcands darkcands

gen darkjamjul=. 
replace darkjamjul=1 if tgroup==3 // Dark Julie
replace darkjamjul=0 if tgroup==6 // Dark James 
tab darkjamjul



////////// CONSTRUCTING DEPENDENT VARIABLES //////////

// Likelihood of voting for candidate
tab q283 
gen vote_re=(q283-1)/4
tab vote_re


// Likelihood of receiving the Black vote 
tab q291
gen blackvote_re=(q291-1)/4
tab blackvote_re


// Ability to Represent Interests 
tab q286 
gen rep_re=(q286-1)/4
tab rep_re 

//////// CONSTRUCTING CONTROL VARIABLES ///////////

**Age
tab q6
destring q6, force replace 
gen age_re=(q6-18)/68
tab age_re

**Education 
tab q12
gen ed_re=(q12-1)/6
tab ed_re

**Income 
tab q14
gen inc_re=(q14-1)/11
tab inc_re

**Gender 
tab q8
gen female=(q8-1)/1
tab female

**Skin tone
tab q64
gen light2dark=(q64-1)/4
tab light2dark

**PID
tab q52
tab q54 //stong dem
tab q56 //strong repub
tab q58

gen dem=. 
replace dem=7 if q54==1
replace dem=6 if q54==2
replace dem=5 if q58==1
replace dem=4 if q58==3
replace dem=3 if q58==2
replace dem=2 if q56==2
replace dem=1 if q56==1
tab dem

gen democrat=(dem-1)/6
tab democrat


sum inc_re ed_re age_re female democrat light2dark // inc .38  ed .60  age  .33  female .50 dem .78  light2dark .50


////////////////////////////////////// FIGURES 1 - 4 ///////////////////////////////

//Figure 1: 
ttest vote_re if tonegroup==2|tonegroup==3, by(tonegroup)
cibar vote_re, over1(ldkpool) barlabel(on)


//Figure 2: 
ttest rep_re if tonegroup==2|tonegroup==3, by(tonegroup)
cibar rep_re, over1(ldkpool) barlabel(on)


//Figure 3: 
ttest blackvote_re if tonegroup==2|tonegroup==3, by(tonegroup)
cibar blackvote_re, over1(ldkpool) barlabel(on)


//Figure 4: Coeffiecient Plots 
**Model 1: Light v. Dark Julie
quietly reg vote_re i.toneJulie if gc==1|inc_re==.38|ed_re==.60|age==.33|female==.50|democrat==.78|light2dark==.50
quietly eststo vote_Julie2
quietly reg blackvote_re i.toneJulie if gc==1|inc_re==.38|ed_re==.60|age==.33|female==.50|democrat==.78|light2dark==.50
quietly eststo blackvote_Julie2
quietly reg rep_re i.toneJulie if gc==1|inc_re==.38|ed_re==.60|age==.33|female==.50|democrat==.78|light2dark==.50
quietly eststo rep_Julie2
coefplot vote_Julie2 blackvote_Julie2 rep_Julie2, drop(_cons) xline(0)


**Model 2: Light v. Dark James  
quietly reg vote_re i.toneJames if gc==1|inc_re==.38|ed_re==.60|age==.33|female==.50|democrat==.78|light2dark==.50
quietly eststo vote_James4
quietly reg blackvote_re i.toneJames if gc==1|inc_re==.38|ed_re==.60|age==.33|female==.50|democrat==.78|light2dark==.50
quietly eststo blackvote_James4
quietly reg rep_re i.toneJames if gc==1|inc_re==.38|ed_re==.60|age==.33|female==.50|democrat==.78|light2dark==.50
quietly eststo rep_James4
coefplot vote_James4 blackvote_James4 rep_James4, drop(_cons) xline(0)

**Model 3: Dark James v. Dark Julie 
quietly reg vote_re i.darkjamjul if gc==1|inc_re==.38|ed_re==.60|age==.33|female==.50|democrat==.78|light2dark==.50
quietly eststo vote_darkjamjul
quietly reg rep_re i.darkjamjul if gc==1|inc_re==.38|ed_re==.60|age==.33|female==.50|democrat==.78|light2dark==.50
quietly eststo rep_darkjamjul
quietly reg blackvote_re i.darkjamjul if gc==1|inc_re==.38|ed_re==.60|age==.33|female==.50|democrat==.78|light2dark==.50
quietly eststo blackvote_darkjamjul
coefplot vote_darkjamjul blackvote_darkjamjul rep_darkjamjul, drop(_cons) xline(0)




////////////////////////////////////// APPENDIX ANALYSES //////////////////////////

// III. Skin Tone of Respondents 
gen light2dark3=light2dark
recode light2dark3 (0=1)(.25=2)(.50=3)(.75=4)(1=5)
lab def light2dark3 1"Very Light" 2"Light" 3"Medium" 4"Dark" 5"Very Dark"
lab val light2dark3 light2dark3
tab light2dark3
histogram light2dark3, frequency
tab  tgroup light2dark3

//IV. Test Stats for Balance in Covariates 
hotelling inc_re ed_re age_re female democrat if tonegroup==1|tonegroup==2, by(tonegroup) // No Image to Light Images 
hotelling inc_re ed_re age_re female democrat if tonegroup==1|tonegroup==3, by(tonegroup) // No Image to Dark Images 
hotelling inc_re ed_re age_re female democrat if tonegroup==2|tonegroup==3, by(tonegroup) // Light to Dark Images 

hotelling inc_re ed_re age_re female democrat if tgroup==1|tgroup==2, by(tgroup) // No Image to Light Julie
hotelling inc_re ed_re age_re female democrat if tgroup==1|tgroup==3, by(tgroup) // No Image to Dark Julie
hotelling inc_re ed_re age_re female democrat if tgroup==2|tgroup==3, by(tgroup) // Light Julie to Dark Julie

hotelling inc_re ed_re age_re female democrat if tgroup==4|tgroup==5, by(tgroup) //James No Image to Light James
hotelling inc_re ed_re age_re female democrat if tgroup==4|tgroup==6, by(tgroup) //James No Image to Dark James
hotelling inc_re ed_re age_re female democrat if tgroup==5|tgroup==6, by(tgroup) //Light to Dark James 


//V. Effect Sizes 
**Pooled Conditions 
ttest vote_re, by(pooled)
esize twosample vote_re, by(pooled) cohensd
esize twosample vote_re, by(pooled) cohensd hedgesg glassdelta

ttest rep_re, by(pooled)
esize twosample rep_re, by(pooled) cohensd 
esize twosample rep_re, by(pooled) cohensd hedgesg glassdelta

ttest blackvote_re, by(pooled)
esize twosample blackvote_re, by(pooled) cohensd 
esize twosample blackvote_re, by(pooled) cohensd hedgesg glassdelta


**Julie Conditions 
ttest vote_re, by(womenconds2)
esize twosample blackvote_re, by(womenconds2) cohensd 

ttest rep_re, by(womenconds2)
esize twosample rep_re, by(womenconds2) cohensd 

ttest blackvote_re, by(womenconds2)
esize twosample blackvote_re, by(womenconds2) cohensd 


**James Conditions 
ttest vote_re, by(menconds2)
esize twosample vote_re, by(menconds2) cohensd 

ttest rep_re, by(menconds2)
esize twosample rep_re, by(menconds2) cohensd 

ttest blackvote_re, by(menconds2)
esize twosample blackvote_re, by(menconds2) cohensd 


**Dark Julie and Dark James 
gen darkcandJulie=. 
replace darkcandJulie=0 if menconds2==1 // Dark James
replace darkcandJulie=1 if womenconds2==1 // Dark Julie 
tab darkcandJulie 

lab def darkcandJulie 0"Dark James" 1"Dark Julie"
lab val darkcandJulie darkcandJulie
tab darkcandJulie

ttest blackvote_re, by(darkcandJulie)
esize twosample blackvote_re, by(darkcandJulie) cohensd hedgesg glassdelta


//VI. Regression Analyses 

**Table 1: Pooled 
reg vote_re pooled female democrat ed_re inc_re age_re light2dark
reg rep_re pooled female democrat ed_re inc_re age_re light2dark
reg blackvote_re pooled female democrat ed_re inc_re age_re light2dark

**Table 2: Women Candidates
reg vote_re womenconds2 female democrat ed_re inc_re age_re light2dark
reg rep_re womenconds2 female democrat ed_re inc_re age_re light2dark
reg blackvote_re womenconds2 female democrat ed_re inc_re age_re light2dark

**Table 3: Men Candidates
reg vote_re menconds2 female democrat ed_re inc_re age_re light2dark
reg rep_re menconds2 female democrat ed_re inc_re age_re light2dark
reg blackvote_re menconds2 female democrat ed_re inc_re age_re light2dark

**Table 4: Dark Julie vs. Dark James 
reg vote_re darkcandJulie female democrat ed_re inc_re age_re light2dark
reg rep_re darkcandJulie female democrat ed_re inc_re age_re light2dark
reg blackvote_re darkcandJulie female democrat ed_re inc_re age_re light2dark


//VII. Full Experimental Results with Comparison to Control 

**Figure 5: Coefficient Plots for Female Candidates 
quietly reg vote_re i.womenconds if gc==1|inc_re==.38|ed_re==.60|age==.33|female==.50|democrat==.78|light2dark==.50
quietly eststo vote_Julie
quietly reg rep_re i.womenconds if gc==1|inc_re==.38|ed_re==.60|age==.33|female==.50|democrat==.78|light2dark==.50
quietly eststo rep_Julie 
quietly reg blackvote_re i.womenconds if gc==1|inc_re==.38|ed_re==.60|age==.33|female==.50|democrat==.78|light2dark==.50
quietly eststo blackvote_Julie 
coefplot vote_Julie rep_Julie blackvote_Julie, drop(_cons) xline(0)

**Figure 6: Coefficient Plots for Male Candidates 
quietly reg vote_re i.menconds if gc==1|inc_re==.38|ed_re==.60|age==.33|female==.50|democrat==.78|light2dark==.50
quietly eststo vote_James
quietly reg rep_re i.menconds if gc==1|inc_re==.38|ed_re==.60|age==.33|female==.50|democrat==.78|light2dark==.50
quietly eststo rep_James 
quietly reg blackvote_re i.menconds if gc==1|inc_re==.38|ed_re==.60|age==.33|female==.50|democrat==.78|light2dark==.50
quietly eststo blackvote_James 
coefplot vote_James rep_James blackvote_James, drop(_cons) xline(0)

**Figure 7: Mean - Willingness to Vote for Candidate
cibar vote_re, over1(tgroup2) barlabel(on)

**Figure 8: Mean - Likelihood of Receiving the Black Vote
cibar blackvote_re, over1(tgroup2) barlabel(on)

**Figure 9: Mean - Ability to Represent Interests 
cibar rep_re, over1(tgroup2) barlabel(on)


//VIIII. Unpacking the Role of Gender 

** Creating variables to look at gender differences in each condition ** 
gen gendinconds_julie=. 
replace gendinconds_julie=1 if tgroup==1 & female==0 // black men in no image Julie 
replace gendinconds_julie=2 if tgroup==1 & female==1 //black women in no image Julie
tab gendinconds_julie

gen gendinconds_LTjulie=. 
replace gendinconds_LTjulie=1 if tgroup==2 & female==0 // black men in  Light Julie 
replace gendinconds_LTjulie=2 if tgroup==2 & female==1 //black women in Light Julie
tab gendinconds_LTjulie


gen gendinconds_DKjulie=. 
replace gendinconds_DKjulie=1 if tgroup==3 & female==0 // black men in  Dark Julie 
replace gendinconds_DKjulie=2 if tgroup==3 & female==1 //black women in Dark Julie
tab gendinconds_DKjulie

gen gendinconds_james=. 
replace gendinconds_james=1 if tgroup==4 & female==0 // black men in no image james 
replace gendinconds_james=2 if tgroup==4 & female==1 //black women in no image james
tab gendinconds_james

gen gendinconds_LTjames=. 
replace gendinconds_LTjames=1 if tgroup==5 & female==0 // black men in  Light Julie 
replace gendinconds_LTjames=2 if tgroup==5 & female==1 //black women in Light Julie
tab gendinconds_LTjames

gen gendinconds_DKjames=. 
replace gendinconds_DKjames=1 if tgroup==6 & female==0 // black men in  Dark Julie 
replace gendinconds_DKjames=2 if tgroup==6 & female==1 //black women in Dark Julie
tab gendinconds_DKjames


**Figure 10: Likelihood of Voting for Candidate by Treatment Condition and Gender
ttest vote_re if gendinconds_julie==1|gendinconds_julie==2, by(gendinconds_julie) 
ttest vote_re if gendinconds_LTjulie==1|gendinconds_LTjulie==2, by(gendinconds_LTjulie) 
ttest vote_re if gendinconds_DKjulie==1|gendinconds_DKjulie==2, by(gendinconds_DKjulie)
ttest vote_re if gendinconds_james==1|gendinconds_james==2, by(gendinconds_james)
ttest vote_re if gendinconds_LTjames==1|gendinconds_LTjames==2, by(gendinconds_LTjames) 
ttest vote_re if gendinconds_DKjames==1|gendinconds_DKjames==2, by(gendinconds_DKjames)
cibar vote_re, over1(female) over2(tgroup2) barlabel(on)

**Figure 11: Ability to Represent Interests by Treatment Condition and Gender
ttest rep_re if gendinconds_julie==1|gendinconds_julie==2, by(gendinconds_julie)
ttest rep_re if gendinconds_LTjulie==1|gendinconds_LTjulie==2, by(gendinconds_LTjulie) 
ttest rep_re if gendinconds_DKjulie==1|gendinconds_DKjulie==2, by(gendinconds_DKjulie)
ttest rep_re if gendinconds_james==1|gendinconds_james==2, by(gendinconds_james) 
ttest rep_re if gendinconds_LTjames==1|gendinconds_LTjames==2, by(gendinconds_LTjames) 
ttest rep_re if gendinconds_DKjames==1|gendinconds_DKjames==2, by(gendinconds_DKjames)
cibar rep_re, over1(female) over2(tgroup2) barlabel(on)


**Figure 12: Likelihood of Receiving Black Vote by Treatment Condition and Gender
ttest blackvote_re if gendinconds_julie==1|gendinconds_julie==2, by(gendinconds_julie) 
ttest blackvote_re if gendinconds_LTjulie==1|gendinconds_LTjulie==2, by(gendinconds_LTjulie) 
ttest blackvote_re if gendinconds_DKjulie==1|gendinconds_DKjulie==2, by(gendinconds_DKjulie)
ttest blackvote_re if gendinconds_james==1|gendinconds_james==2, by(gendinconds_james)
ttest blackvote_re if gendinconds_LTjames==1|gendinconds_LTjames==2, by(gendinconds_LTjames) 
ttest blackvote_re if gendinconds_DKjames==1|gendinconds_DKjames==2, by(gendinconds_DKjames)
cibar blackvote_re, over1(female) over2(tgroup2) barlabel(on)





